import os
from config import DIR_PATH
from lib.HTMLTestRunner_HeiMa import HTMLTestRunner
import unittest

# 1、定义测试套件
suite = unittest.defaultTestLoader.discover("./script",pattern="test*.py")
# 2、定义报告位置及名称
report_dir = DIR_PATH + os.sep + "report" + os.sep + "p2p.html"
# 3、获取文件流及运行测试套件
with open(report_dir,"wb") as f:
    HTMLTestRunner(stream=f,title="P2P金融项目投资业务接口测试报告").run(suite)